package com.example.statemachine.event;

import com.example.statemachine.core.StateEnum;
import com.example.statemachine.core.StateMachineContext;
import lombok.Getter;
import org.springframework.context.ApplicationEvent;

@Getter
public class StateChangeEvent extends ApplicationEvent {
    private final Object entity;
    private final StateEnum fromState;
    private final StateEnum toState;
    private final StateMachineContext context;

    public StateChangeEvent(Object entity, StateEnum fromState,
                            StateEnum toState, StateMachineContext context) {
        super(entity);
        this.entity = entity;
        this.fromState = fromState;
        this.toState = toState;
        this.context = context;
    }
}